﻿<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <title>商圈</title>
  <link rel="stylesheet" type="text/css" href="../plugins/weui/css/weui.min.css">
  <link rel="stylesheet" type="text/css" href="../css/base.css">
  <link rel="stylesheet" type="text/css" href="../css/css.css">
  <link rel="stylesheet" href="../css/app.css">
    <link rel="stylesheet" href="../css/blog.css">
</head>
<body>


  <div class="content1">
    <div id="list" style="width: 95%;margin-left: auto;margin-right: auto;">
      <!--动态列表-->
      <ul class="content">
      </ul>
    </div>
  </div>
  <div class="float-btn">
    <img src="../images/boss/10.png">
  </div>
  <div class="sendMsg">
    <div class="sendMsg_content">
      <input type="text" id="bloginput" value="">
      <span onclick="blogAdd()">发送</span>
    </div>
  </div>
  <div class="weui-tabbar tabbar">
    <a href="bossRadarIndex.html" class="weui-tabbar__item">
			<img src="../images/tabbar/10.png" alt="" class="weui-tabbar__icon">
			<p class="weui-tabbar__label">AI销售</p>
		</a>
    <a class="weui-tabbar__item a_msg_list">
			<img src="../images/tabbar/12.png" alt="" class="weui-tabbar__icon">
			<p class="weui-tabbar__label">消息</p>
		</a>
    <a href="contactPerson.html" class="weui-tabbar__item">
			<img src="../images/tabbar/14.png" alt="" class="weui-tabbar__icon">
			<p class="weui-tabbar__label">客户</p>
		</a>
    <a href="javascript:;" class="weui-tabbar__item">
			<img src="../images/tabbar/15.png" alt="" class="weui-tabbar__icon">
			<p class="weui-tabbar__label" style="color:#FD4D01;">商圈</p>
		</a>
    <a href="myself.html" class="weui-tabbar__item">
			<img src="../images/tabbar/18.png" alt="" class="weui-tabbar__icon">
			<p class="weui-tabbar__label">我</p>
		</a>
  </div>
</body>
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="../plugins/weui/js/weui.min.js"></script>
<script type="text/javascript" src="../js/base.js"></script>
<script type="text/javascript" src="../js/blog.js"></script>
<script type="text/javascript">
  var tailkBoid = null;
  $(function() {
      loadBlog();
      //聊天会话链接
      $(".a_msg_list").click(function () {
          toUrl(siteUrlList.ImMessageList + "?uid=" + userid);
      });

  })

  //加载微博动态
  function loadBlog() {
    ajaxGet(siteApiList.BlogList + "?uid=0&storeid=" + storeid, function(data) {
      if (!isJsonSuccess(data))
        return;
      if (data.Data == null) return;
      var html = "";
      for (var i = 0; i < data.Data.BlogList.length; i++) {
        html += getItemHtml(data.Data.BlogList[i]);
      }
      $(".content").html(html);
      loadBtn();
    });
  }

  function getItemHtml(item) {
    var upList = getUpList(item.UpList);
    var commentList = getCommentList(item.CommentList); //评论列表
    var html = "";
    html += "<li>"
    html += "<div class='po-avt-wrap'><a href='myBlog.html'><img class='po-avt data-avt' src='" + siteConfig.formatAvater(item.Avater) + "'></a></div>"
    html += "<div class='po-cmt'>"
    html += "<div class='po-hd'>"
    html += "<p class='po-name' style='margin-top: -5px;'><span class='data-name f18'>" + item.NickName + "</span></p>"
    html += "<div class='post'>"
    html += "<p style='padding: 5px 0 10px; 0;'>" + item.Content + "</p>"
    html += "<div id='picList'>"
    html += getImgs(item.Imgs.split(",")); //图片列表
    html += "</div>"
    html += "</div>"
    html += "<div style='width: 100%;height: 20px;clear: both;'></div>"
    html += "<div class='padding-top:20px;'>"
    html += "<p class='time'>" + item.Addtime
    if (item.Uid == userid)
      html += "<span class='delect btn-delete' data-id=" + item.Id + ">删除</span></p>"; //自己发布的才能删除
    html += "<div style='position: relative;'>"
    //点赞操作
    html += "<div class='actions_box f12' id='actions_" + item.Id + "' style='display: none; width: 0px;'>"
    html += "<div class='actions-left'onclick='upAdd(" + item.Id + ")'  style='border-right: 1px solid #2E2E32'><img src='../images/boss/like2.png' alt='' ><span>赞</span></div>"
    html += "<div class='actions-left tailk' data-index='" + item.Id + "' ><img src='../images/boss/taik.png' alt=''><span>评论</span></div>"
    html += "</div>"
    html += "<img class='c-icon' data-index='" + item.Id + "' src='../images/boss/12.png' id='up' >"
    html += "</div>"
    html += "<div style='clear: both;'></div>"
    html += "</div>"
    if (upList != '' || commentList != '') {
        html += "<div class='r'></div>"
        html += '<div class="cmt-wrap">'
        if (upList != '')
            html += '<div class="like"><img src="../images/boss/like1.png">' + upList + '</div>';
        if (commentList != '')
            html += '<div class="cmt-list" style="border-top: 1px solid #ddd;">' + commentList + '</div>'
        html += "</div>"
    }

    html += "<div style='clear: both;border-bottom: 1px solid #ddd;padding-top: 20px;'></div>"
    html += "</li>"
    return html;
  }

  function loadBtn() {
    $(".btn-delete").click(function() {
      deleteBlog($(this).attr("data-id"))
    });
    //点赞评论弹出框
    $(".c-icon").click(function (e) {
        var index = $(this).attr("data-index");
        var width = $("#actions_" + index).css("width");
        if (width == '0px') {
            //隐藏弹出框
            $(".actions_box").css("width", "0px");
            $(".actions_box").css("display", "none");
            //显示弹出框
            $("#actions_" + index).css("display", "flex").animate({
                width: "150px"
            });
        } else {
            //隐藏弹出框
            $(".actions_box").css("width", "0px");
            $(".actions_box").css("display", "none");
        }
    })


    //评论
    $(".tailk").on("click", function() {
      tailkBoid = $(this).attr('data-index');
      $(".tabbar").hide();
      $(".sendMsg").show();
    })

    //发动态
    $(".float-btn").on("click", function() {
      toUrl("editor.html")
    })
  }
</script>

</html>
